<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\datepicker\DatePicker;

/* @var $this yii\web\View */
/* @var $model app\models\Client */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="client-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'client_id')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'client_name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'client_password')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'client_appkey')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'is_active')->textInput() ?>

    <?= $form->field($model, 'qqnumber')->textInput(['maxlength' => true]) ?>
<?php
if($model->begindate){
    $model->begindate = date('Y-m-d',$model->begindate);
}
if($model->enddate){
    $model->enddate = date('Y-m-d',$model->enddate);
}

?>
    <?= $form->field($model, 'begindate')->textInput()->widget(
        DatePicker::className(),
        [
//            'inline' => true,
            // modify template for custom rendering
            'language' => 'zh-CN',
            'value'=> 1,
            'clientOptions' => [
                'autoclose' => true,
                'format' => 'yyyy-mm-dd',
            ]
        ]) ?>

    <?= $form->field($model, 'enddate')->textInput()->widget(
        DatePicker::className(),
        [
//            'inline' => true,
            // modify template for custom rendering
//            'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>',
            'language' => 'zh-CN',
            'clientOptions' => [
                'autoclose' => true,
                'format' => 'yyyy-mm-dd'
            ]
        ]
    ) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
